package com.liyuhan.onlinetaxibackground.Repository;

import com.liyuhan.onlinetaxibackground.POJO.BasicOrder;
import com.liyuhan.onlinetaxibackground.POJO.Driver;
import com.liyuhan.onlinetaxibackground.POJO.Passenger;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface BasicOrderRepository extends JpaRepository<BasicOrder, Integer> {
    // 根据乘客获取订单
    Optional<List<BasicOrder>> findBasicOrdersByPassenger(Passenger passenger);

    // 根据乘客和状态获取订单
    Optional<List<BasicOrder>> findBasicOrdersByPassengerAndState(Passenger passenger, String state);

    // 根据订单状态获取订单
    Optional<List<BasicOrder>> findBasicOrdersByState(String state);
}
